package com.zxkj.domain.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;

@Embeddable
public class SciMapDeptAdPK implements Serializable {
    public SciMapDeptAdPK() {
    }

    public SciMapDeptAdPK(Integer deptId, String adId) {
        this.deptId = deptId;
        this.adId = adId;
    }

    private static final long serialVersionUID = -2432145316543676L;
    @Column(nullable = false)
    private String adId;
    @Column(nullable = false)
    private Integer deptId;

    public String getAdId() {
        return adId;
    }

    public void setAdId(String adId) {
        this.adId = adId;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SciMapDeptAdPK that = (SciMapDeptAdPK) o;

        if (adId != null ? !adId.equals(that.adId) : that.adId != null) return false;
        return deptId != null ? deptId.equals(that.deptId) : that.deptId == null;
    }

    @Override
    public int hashCode() {
        int result = adId != null ? adId.hashCode() : 0;
        result = 31 * result + (deptId != null ? deptId.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "SciMapDeptAdPK{" +
                "adId='" + adId + '\'' +
                ", deptId=" + deptId +
                '}';
    }
}
